import * as  XLSX from 'xlsx'


export function getfiletodata(file: File, start = 0, end = Infinity): Promise<XLSX.WorkBook> {
    return new Promise((res, rej) => {
        const reader = new FileReader();
        reader.onload = e => {
            /* Parse data */
            if (!e.target) return
            const bstr = e.target.result;

            const wb = XLSX.read(bstr, {
                type: "binary"
            });
            res(wb)
        };
        reader.readAsBinaryString(file);
    })

}
